package com.ssis.core;

import com.ssis.graphics.Sprite;

public class AssignmentCursor {
	private int assignmentIndex;
	private Sprite sprite;
	
	public AssignmentCursor() {
		assignmentIndex = 0;
		sprite = new Sprite("crew_assignments_cursor", HUDCrew.ASSIGNMENTS_X_OFFSET, HUDCrew.ASSIGNMENTS_Y_OFFSET);
	}
	
	public void render() {
		sprite.moveto(HUDCrew.ASSIGNMENTS_X_OFFSET + (assignmentIndex % 4) * HUDCrew.ASSIGNMENT_WIDTH, HUDCrew.ASSIGNMENTS_Y_OFFSET + (assignmentIndex / 4) * HUDCrew.ASSIGNMENT_WIDTH);
		sprite.render();
	}
	
	public void select(int selected) {
		assignmentIndex = selected;
	}
	
	public int selected() {
		return assignmentIndex;
	}
}
